package com.love_weinuo.util.dialog;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;

import com.love_weinuo.R;
import com.love_weinuo.databinding.DialogInputLandNameBinding;
import com.love_weinuo.util.ToastUtil;
import com.love_weinuo.util.listener.OnBHClickListener;
import com.love_weinuo.util.listener.OnLandNameInputListener;

/**
 * Created by Administrator on 2019/3/15.
 */

public class InputLandNameDialog extends BaseDialog {

    Context context;
    DialogInputLandNameBinding binding;
    OnLandNameInputListener listener;

    public InputLandNameDialog(Context context) {
        super(context);
        this.context = context;
        binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_input_land_name,null,false);
        binding.setDialog(this);
        setContentView(binding.getRoot());
    }

    public void setOnLandNameClickListener(OnLandNameInputListener listener) {
        this.listener = listener;
    }

    public void noPoint(View view){
        dismiss();
    }

    public void okPoint(View view){
        String landName = binding.dialogRemind.getText().toString().trim();
        if (TextUtils.isEmpty(landName)) {
            ToastUtil.showToast("请输入土地名称");
            return;
        }
        if (listener != null) {
            listener.setOnLandNameInputListener(landName);
        }
        dismiss();
    }
}


